﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Input;
using Devmil.MVVM.Notification;
using System.ComponentModel;

namespace Devmil.MVVM.Sample.ViewModel
{
    public class ContactViewModel : IFireNotifyPropertyChanged
    {
        private string _Name;

        public string Name
        {
            get
            {
                using (this.Track(p => p.Name))
                    return _Name;
            }
            set
            {
                this.SetPropertyValue(p => p.Name, ref _Name, value);
            }
        }

        public void FireNotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
